from app import app, db
from sqlalchemy import text

def verify_users_direct():
    with app.app_context():
        # 使用 SQL 查询用户 - 使用 text() 包装
        result = db.session.execute(
            text("SELECT username, email, role FROM user")
        ).fetchall()
        
        print(f"📊 找到 {len(result)} 个用户:")
        print("-" * 50)
        
        for user in result:
            print(f"👤 用户名: {user.username}")
            print(f"📧 邮箱: {user.email}")
            print(f"🎭 角色: {user.role}")
            print("-" * 30)

if __name__ == '__main__':
    verify_users_direct()